package com.jecy.springcloud.web;

import com.jecy.springcloud.model.User;
import com.jecy.springcloud.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by huijun on 17/6/30.
 */
@RestController
public class UserController {
    @Autowired
    private UserService userService;

    @RequestMapping(value = "/user")
    public ResponseEntity<List<User>> readUserInfo() {
        List<User> users = userService.readUserInfo();
        return new ResponseEntity<List<User>>(users, HttpStatus.OK);
    }
}
